<form id="searchbox" name="searchForm" ng-init="dvm.init()" ng-submit="vm.execute(searchForm.$valid)" novalidate>
  <div class="modal-header">
    <button type="button" class="close" ng-click="dvm.close()">&times;</button>
    <h4 class="modal-title">查找/替换</h4>
  </div>
  <div class="modal-body">
    <div class="form-group">
      <input name="needle" type="text" class="form-control" ng-model="dvm.context.needle" required autofocus
          placeholder="查找内容">
    </div>
    <div class="form-group">
      <input type="text" class="form-control" ng-model="dvm.context.replace" placeholder="替换为">
    </div>
    <div class="form-group">
      <label class="radio-inline">
        <input name="backwards" type="radio" ng-value="false" ng-model="dvm.context.backwards">向前
      </label>
      <label class="radio-inline">
        <input name="backwards" type="radio" ng-value="true" ng-model="dvm.context.backwards">向后
      </label>
    </div>
    <div class="form-group">
      <label class="checkbox-inline">
        <input type="checkbox" ng-value="true" ng-model="dvm.context.caseSensitive">区分大小写
      </label>
      <label class="checkbox-inline">
        <input type="checkbox" ng-value="true" ng-model="dvm.context.wholeWord">全单词匹配
      </label>
    </div>
    <div class="form-group">
      <label class="checkbox-inline">
        <input type="checkbox" ng-value="true" ng-model="dvm.context.regExp">正则表达式
      </label>
      <label class="checkbox-inline">
        <input type="checkbox" ng-value="true" ng-model="dvm.context.wrap">回到文档顶部
      </label>
    </div>
  </div>
  <div class="modal-footer">
    <button type="submit" class="btn btn-default" ng-click="dvm.find()"
        ng-disabled="dvm.context.needle == '' || dvm.disabled"><i class="fa fa-search"></i> 查找</button>
    <div class="btn-group">
      <button type="button" class="btn btn-default" ng-click="dvm.replace()"
          ng-disabled="dvm.context.needle == '' || dvm.disabled"><i class="fa fa-exchange"></i> 替换</button>
      <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
          ng-disabled="dvm.context.needle == '' || dvm.disabled"><span class="caret"></span></button>
      <ul class="dropdown-menu dropdown-menu-right">
        <li><a href="javascript:void(0)" ng-click="dvm.replaceAll()">替换全部</a></li>
      </ul>
    </div>
  </div>
</form>
